Skip to main content

View Post [edit]

Poster: David Fifield Date: Feb 18, 2018 10:24am
Forum: movies Subject: Re: 'Uploaded content is unacceptable' when filename ends in ':.mp4'

The same error happens with videos whose filename ends in :.webm. There is no error with audio files whose filename ends in :.mp3.

However, even with video files, there is no error when there are two colons in the filename, for some reason. So for example while I couldn't upload 36. 2009-11-16 - Lecture 32:.mp4, I could upload 25. 2011-03-16 - Lecture 23: Prokaryotic Gene Regulation:.mp4.

Here again is a test script:
import internetarchive
import requests
METADATA = {
"collection": "test_collection",
"mediatype": "movies",
}
MP3_FILENAME = "silence.mp3"
WEBM_FILENAME = "blue.webm"
MP4_FILENAME = "blue.mp4"
IDENTIFIER = "TEST_filename_extension_movies4"
for remote_filename, local_filename in (
("silence.mp3", MP3_FILENAME),
("silence:.mp3", MP3_FILENAME),
("silence::.mp3", MP3_FILENAME),
("silence: silence:.mp3", MP3_FILENAME),

("blue.webm", WEBM_FILENAME),
("blue:.webm", WEBM_FILENAME),
("blue::.webm", WEBM_FILENAME),
("blue: blue:.webm", WEBM_FILENAME),

("blue.mp4", MP4_FILENAME),
("blue:.mp4", MP4_FILENAME),
("blue::.mp4", MP4_FILENAME),
("blue: blue:.mp4", WEBM_FILENAME),
):
try:
internetarchive.upload(IDENTIFIER, files=[(remote_filename, local_filename)], metadata=METADATA, queue_derive=False)
print "%s\tOK" % remote_filename
except requests.exceptions.HTTPError as e:
print "%s\t%s" % (remote_filename, repr(e))


Its output:
silence.mp3	OK
silence:.mp3 OK
silence::.mp3 OK
silence: silence:.mp3 OK
blue.webm OK
blue:.webm HTTPError(u' error uploading blue:.webm to TEST_filename_extension_movies4, Uploaded content is unacceptable. - video file has improper extension, try one of these: .webm',)
blue::.webm OK
blue: blue:.webm OK
blue.mp4 OK
blue:.mp4 HTTPError(u' error uploading blue:.mp4 to TEST_filename_extension_movies4, Uploaded content is unacceptable. - video file has improper extension, try one of these: .mp4 .mpeg4 .m4b .m4v',)
blue::.mp4 OK
blue: blue:.mp4 OK


Attachment: blue.mp4
Attachment: blue.webm
Attachment: silence.mp3